ZK Spring 1.1.0 Release configuration details
This documentation is for an older version of ZK. For the latest one, please click here.
Copy spring.jar into your Web library
All above sections have been updated for ZK Spring 3.0RC release. Most of them still apply to applications using ZK Spring 1.1.0 release except following sections. Appropriate links for these sections have been provided above.
Before using Spring, you have to download it, and put the jar file into the directory of your web application.
- Download Spring 2.5 release download
- Put spring.jar into your
$myApp/WEB-INF/lib/
$myApp represents the name of your web application.
Prerequisite for using Spring Security with ZK Spring 1.1.0 release
To make Spring Security work with ZK properly, you have to copy the following jars to /WEB-INF/lib.
- ZK Spring Integration Library jar file
- zkspring.jar
- Spring Security library jar files
- aopalliance-1.0.jar
- aspectjrt-1.5.4.jar
- commons-codec-1.3.jar
- commons-collections-3.2.jar
- commons-lang.jar
- commons-logging-1.1.1.jar
- jstl-1.1.2.jar
- log4j-1.2.14.jar
- spring-security-acl-2.0.3.jar
- spring-security-core-2.0.3.jar
- spring-security-core-tiger-2.0.3.jar
- spring-security-taglibs-2.0.3.jar
- spring.jar
- standard-1.1.2.jar
Create /WEB-INF/applicationContext-security.xml for Spring 2 release
Create application-security.xml
file under $myApp/WEB-INF/
. This file include required configuration of spring-security.
<!--
- Spring namespace-based configuration
-->
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-2.0.1.xsd">
.
.
.
</beans:beans>
Define which ZK event to be secured for ZK Spring 1.1.0 release
In /WEB-INF/applicationContext-security.xml, define required configurations of the namespace of zk, and specify which ZK event to secure as follows,
<!--
- Spring namespace-based configuration
-->
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:zksp="http://www.zkoss.org/2008/zkspring"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-2.0.1.xsd
http://www.zkoss.org/2008/zkspring
http://www.zkoss.org/2008/zkspring/zkspring.xsd">
...
</beans:beans>
- xmlns:zksp="http://www.zkoss.org/2008/zkspring tells the Spring Security engine that we will use the ZK Spring namespace configuration and define the name space to zksp.
- http://www.zkoss.org/2008/zkspring http://www.zkoss.org/2008/zkspring/zkspring.xsd tells the Spring Security engine where to find such ZK Spring namespace configuration schema.